package com.situ.day12.hom;

public class Fang {
	private Double x;
	
	public Fang() {
		this.x = 0.0;
	}
	public void sunShu(double num) throws Ping{
		if (num >= 0) {
			x = Math.sqrt(num);
		}else {
			throw new Ping();
		}
	}
	public Double getX() {
		return x;
	}
	public void setX(Double x) {
		this.x = x;
	}
	

}
